using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PACKETPARSERMAX20.CORE
{
	public class gameobject_battleground : MangosBase
	{
		public System.UInt32? guid;
		public System.Byte? event1;
		public System.Byte? event2;




		public override string GetInsertCommand()
		{
			return string.Format("INSERT IGNORE INTO `gameobject_battleground` (`guid`, `event1`, `event2`) VALUES ('{0}', '{1}', '{2}');", guid.GetValueOrDefault(), event1.GetValueOrDefault(), event2.GetValueOrDefault());
		}


		public override string GetUpdateCommand()
		{
            StringBuilder sb = new StringBuilder();
						sb.Append("UPDATE `gameobject_battleground` SET ");
			if(event1 != null)
			{
				sb.AppendLine("`event1`='" + event1.Value.ToString() + "'");
			}
			if(event2 != null)
			{
				sb.AppendLine("`event2`='" + event2.Value.ToString() + "'");
			}
				sb = sb.Replace("\r\n", ", ");
				sb.Append(" WHERE `guid`='" + guid.Value.ToString() + "';");
				sb = sb.Replace(",  WHERE", " WHERE");

            return sb.ToString();
		}


	}
}
